package com.neu.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.neu.domain.Doctor;
import com.neu.service.DoctorService;
import com.neu.utils.JsonModel;

@Controller
@RequestMapping("/doctor")
public class DoctorController {
	
	@Resource(name="doctorService")
	private DoctorService doctorService;
	
	@RequestMapping("/getDoctorByDeptid")
	@ResponseBody
	public JsonModel getDoctorByDeptid(Integer deptid) {
		JsonModel jsonModel =new JsonModel();
		//调用service方法获取医生信息
		List<Doctor>  doctorList=doctorService.findDoctorByDeptid(deptid);
		System.out.println(doctorList);
		jsonModel.setData(doctorList);
		return jsonModel;
	}
}
